<%@page import="com.kaishengit.entity.CarItem"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    
    <title>订单详情</title>

  </head>
  	
  <body>
    <h3>您的订单详情：</h3>
    <table width="70%" border="1">
    	<tr>
    		<th>商品名称</th>
    		<th>价格</th>
    		<th>数量</th>
    		<th>总价</th>
    	</tr>
    	<%
    		List<CarItem> shopcar = (List<CarItem>)session.getAttribute("shopcar");
    		float total = 0f;
    		if(shopcar != null){
    			for(CarItem item : shopcar){
    				total += item.getTotal();
    	%>		
    	<tr>
    		<td><%=item.getProduct().getProdName() %></td>
    		<td><%=item.getProduct().getPrice() %></td>
    		<td><%=item.getNum() %></td>
    		<td><%=item.getTotal() %></td>
    	</tr>		
    	<%}}%>
    	<tr>
    		<td colspan="4" align="right">金额总计：￥<%=total %></td>
    	</tr>
    </table>
    <h3>请输入订单信息：</h3>
    <form action="product.jspx?task=order" method="post">
    	配送地址：<input type="text" name="address"/>
    	收货人：<input type="text" name="name"/>
    	电话：<input type="text" name="tel"/>
    	<input type="submit" value="提交"/>
    </form>
  </body>
</html>
